package com.zhuangxiaoyan.springboot.mybatis.dao;

import com.zhuangxiaoyan.springboot.mybatis.domain.Address;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * AddressMapper
 *
 * @author xjl
 * @version 2025/01/11 21:25
 **/
@Mapper
public interface AddressMapper {
    /**
     * 插入地址
     * @param address
     * @return
     */
    int insertAddress(Address address);

    /**
     * 更新地址
     * @param address
     * @return
     */
    int updateAddress(Address address);

    /**
     * 删除地址
     * @param id
     * @return
     */
    int deleteAddress(long id);

    /**
     * 根据id查询地址
     * @param id
     * @return
     */
    Address getAddressById(long id);

    /**
     * 根据用户id查询地址
     * @param customerId
     * @return
     */
    List<Address> getAddressesByCustomerId(String customerId);

    /**
     * 查询所有地址
     * @return
     */
    List<Address> getAllAddresses();
}